package com.clstu.enum_;

public class EnumExercise02 {
    public static void main(String[] args) {
           Week[] week=Week.values();
           for(Week wk:week){
               System.out.println(wk);
               wk.playing();
           }
    }
}

interface INPlay{
    void playing();
}

enum Week implements INPlay{//因为继承了Enum对象，所有enum类型不能继承其他类，但是可以实现接口
    MONDAY("星期一"),TUESDAY("星期二"),WEDNESDAY("星期三"),
    THURSDAY("星期四"),FRIDAY("星期五"),SATURDAY("星期六"),SUNDAY("星期天");

    private String desc;

    Week(String desc) {
        this.desc = desc;
    }

    public String getDesc() {
        return desc;
    }

    @Override
    public void playing() {
        System.out.println("正在播放好听的音乐...");
    }

    @Override
    public String toString() {
        return name()+"    "+desc;
    }
}